package com.yuanfeng.userms.controller;

import com.yuanfeng.commoms.util.ResponseResult;
import com.yuanfeng.userms.dto.UserSellerBaseDTO;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @ClassName UserSellerBaseController
 * @Description 卖家用户
 * @Author hyq
 * @Date 2023/6/21 11:38
 * @Version 1.0
 **/
@RestController
@RequestMapping("user/sellerBase")
public class UserSellerBaseController extends  BaseController{


    /**
     * 根据shopId查询卖家信息
     *
     * @param returnMap
     * @return
     */
    @PostMapping("/info")
    public ResponseResult getSellerInfo(@RequestBody Map<String, String> returnMap) {
        ResponseResult result=sellerBaseService.getSellerInfo(returnMap);
        return result;
    }

    /**
     * 添加子账号
     * @param userSellerBase
     * @return
     */
    @PostMapping("/add")
    public ResponseResult add(@RequestBody UserSellerBaseDTO userSellerBase){
        ResponseResult result=sellerBaseService.add(userSellerBase);
        return result;
    }

    /**
     * 获取子账号
     * @param paraMap
     * @return
     */
    @PostMapping("/get")
    public ResponseResult get(@RequestBody Map<String, String> paraMap){
        ResponseResult result=sellerBaseService.get(paraMap);
        return result;
    }

    /**
     * 删除子账号
     * @param paraMap
     * @return
     */
    @PostMapping("/delete")
    public ResponseResult delete(@RequestBody Map<String, String> paraMap){
        ResponseResult result=sellerBaseService.delete(paraMap);
        return result;
    }

    /**
     * 编辑子账号
     * @param paraMap
     * @return
     */
    @PostMapping("/update")
    public ResponseResult update(@RequestBody Map<String, String> paraMap){
        ResponseResult result=sellerBaseService.update(paraMap);
        return result;
    }
}
